package demo.IOStream;

import java.io.*;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/8/15-08-15-19:36
 * @Description：demo.IOStream
 */
public class calcNum {
    public static void main(String[] args) {
        FileReader fis = null;
        int count = 0;
        try {
            fis = new FileReader(new File("calcCharNum.txt"));
            int c;
            while((c = fis.read()) != -1){
                if(c=='A' || c == 'a'){
                    count++;
                }
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                if(fis != null){
                    fis.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
